package learn.java.liuyayioschina;
public class HelloWorld
{
	void printOnceHelloWorld()
	{
		System.out.println("Hello World");
	}
	void printHelloWorldEachLineForTenTimes()
	{
		int times=10;
		for(times=0;times<10;times++)
		{
			System.out.println("Hello World\n");
		}
	}
	void printHelloWorldEachLineForTenThousandTimes()
	{
		int times=10000;
		for(times=0;times<10000;times++)
		{
			System.out.println("Hello World\n");
		}
	}
	void printHelloWorldWithItsNumber()
	{
		int times=5;
		for(times=0;times<5;times++)
		{
			int number=times+1;
			System.out.println(number+" Hello World\n");
		}
	}
	void printHelloWorldWithItsNumberEveryFiveLines()
	{
		int times=15;
		for(times=0;times<15;times++)
		{
			int number=times+1;
			if(number%5==0)
			{
				System.out.println(number+" Hello World\n");
			}
			else 
			{
				System.out.println("Hello World\n");
			}
		}
	}
	public static void main(String[] args)
	{
		HelloWorld helloWorld=new HelloWorld();
			helloWorld.printOnceHelloWorld();
		  helloWorld.printHelloWorldEachLineForTenTimes();
			helloWorld.printHelloWorldEachLineForTenThousandTimes();
			helloWorld.printHelloWorldWithItsNumber();
			helloWorld.printHelloWorldWithItsNumberEveryFiveLines();
	}
}